import 'package:flutter/material.dart';
import 'app.dart';
import 'html.dart';

final List<Map> routeConfig = [
  {
    'name':'app',
    'path': '/',
    'builder': (BuildContext context) => new APP()
  },
  {
    'name': 'html',
    'path': '/html',
    'builder': (BuildContext context) => new WebViewDemoPage()
  }
];

class AppRoutes {
  static Map<String, WidgetBuilder> getRoutes() {
    Map<String, WidgetBuilder> map = {};

    routeConfig.forEach((route) {
      map[route['path']] = route['builder'];
    });
    return map;
  }

  static Iterable<Map> getDemos() {
    return routeConfig.where((route) => route['name'] != 'app');
  }
}